<template>
  <view class="start">
    <nut-swiper :init-page="initPage" :pagination-visible="true" pagination-color="#426543" auto-play="0" :height="1000">
      <nut-swiper-item v-for="(item, index) in banners" :key="index">
        <image class="swiper-img" mode="heightFix" :src="item" alt="" />
      </nut-swiper-item>
    </nut-swiper>

    <view class="btn">
      <Button type="primary" size="mini" @click="toIndex">
        进入店铺
      </Button>
    </view>
  </view>
</template>

<script setup lang="ts">
import { ref } from 'vue';
import { Button } from "@tarojs/components";
import Taro from '@tarojs/taro';

const initPage = ref(0)
const banners = ref([
  "https://dcdn.it120.cc/2023/04/20/11bdcd47-f478-4848-a3b5-7cd50e4a4ebd.jpeg",
  "https://dcdn.it120.cc/2023/04/20/0e5d1b55-67be-474d-abd3-1c035f87d1e3.jpg",

])

const toIndex = () => {
  console.log('????');
  Taro.switchTab({
    url: '/pages/index/index',
  })
  
}

</script>

<style lang="scss">
.start {
  width: 100vw;
  height: 100vh;

  .swiper-img {
    width: 100vw;
    height: 100vh;
  }

  .btn {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 50rpx;
    z-index: 100;
    display: flex;
    justify-content: center;
  }
}
</style>